﻿#include "plugin.h"
#include <iostream>

struct FooPlugin
{
    void doSomething()
    {
        std::cout << "FooPlugin" << std::endl;
    }
};

struct BarPlugin
{
    void doSomething()
    {
        std::cout << "BarPlugin" << std::endl;
    }
};

extern "C" const char *getVersion()
{
    return "v0.0.4";
}

extern "C" Plugin *createFooPlugin()
{
    std::cout << "createFooPlugin  444" << std::endl;
    return new Plugin(FooPlugin());
}

extern "C" Plugin *createBarPlugin()
{
    std::cout << "createBarPlugin" << std::endl;
    return new Plugin(BarPlugin());
}

extern "C" void destroyPlugin(Plugin *plugin)
{
    std::cout << "delete plugin:" << plugin << std::endl;
    delete plugin;
}